package cc.admin.modules.sys.service.impl;

import cc.admin.common.constant.CommonConstant;
import cc.admin.common.sys.vo.LoginUser;
import cc.admin.modules.sys.entity.SysShipType;
import cc.admin.modules.sys.entity.SysUser;
import cc.admin.modules.sys.mapper.SysShipTypeMapper;
import cc.admin.modules.sys.service.ISysShipTypeService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Description: 船舶类型
 * @Author: cc-admin
 * @Date:   2021-12-30
 * @Version: V1.0.0
 */
@Service
public class SysShipTypeServiceImpl extends ServiceImpl<SysShipTypeMapper, SysShipType> implements ISysShipTypeService {
@Resource
public SysShipTypeMapper sysShipTypeMapper;
    @Override
    public List<Map<String, String>> shipTypeName() {
        QueryWrapper queryWrapper = new QueryWrapper();
        List<SysShipType> sysShipTypes = sysShipTypeMapper.selectList(queryWrapper);
        List<Map<String,String>> dataList= Lists.newArrayList();
        for (SysShipType shipType:sysShipTypes){
            Map<String,String> map = Maps.newHashMap();
            map.put("label", shipType.getShipTypeName());
            map.put("value",shipType.getShipTypeCode() );
            dataList.add(map);
        }
        return dataList;
    }
}
